<#include "/includes/vars.inc"> 
<@pp.dropOutputFile />
<#assign fileName = "/pom.xml">
<#if !pp.outputFileExists(fileName)>
	<@pp.changeOutputFile name="${fileName}" />

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>${project.@rootPackage}</groupId>
    <artifactId>${project.@projectName?lower_case?replace(" ","-")}</artifactId>
    <version><#if project.@version[0]??>${project.@version}<#else>1.0-SNAPSHOT</#if></version>
    <packaging>war</packaging>

    <name>${project.@projectName}</name>
    <description>${project.@projectName} powered by jeecode 2011-2012</description>

    <properties>
        <java.version>1.6</java.version>
        <spring.version>3.0.5.RELEASE</spring.version>
        <spring-security.version>3.0.5.RELEASE</spring-security.version>
        <hibernate.version>3.6.4.Final</hibernate.version>
        <aspectj.version>1.6.11</aspectj.version>
        <slf4j.version>1.6.4</slf4j.version>
        <jsf.version>2.1.4</jsf.version>
        <primefaces.version>3.0.1</primefaces.version>
        <jetty.version>8.0.1.v20110908</jetty.version>
        <tomcat.version>6.0.16</tomcat.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>

        <!-- database settings -->
        <database.name>${r"${"}project.name}</database.name>
        <database.host>localhost</database.host>
        <database.port>33332</database.port>
        <database.user>root</database.user>
        <database.password>root</database.password>

        <!-- Default values when no database profile is set -->
        <!-- jdbc driver dependency -->
        <jdbc.groupId>org.hsqldb</jdbc.groupId>
        <jdbc.artifactId>hsqldb</jdbc.artifactId>
        <jdbc.version>1.8.0.10</jdbc.version>

        <!-- jdbc default settings -->
        <jdbc.type>hsqldb</jdbc.type>
        <jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
        <jdbc.url>jdbc:hsqldb:mem:defaultDB</jdbc.url>
        <jdbc.user>sa</jdbc.user>
        <jdbc.password></jdbc.password>
        <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
     
    </properties>

    <profiles>
        <profile>
            <id>hsqldb</id>
            <properties>
                <!-- jdbc driver dependency -->
                <jdbc.groupId>hsqldb</jdbc.groupId>
                <jdbc.artifactId>hsqldb</jdbc.artifactId>
                <jdbc.version>1.8.0.10</jdbc.version>
                <!-- jdbc settings -->
                <jdbc.type>hsqldb</jdbc.type>
                <jdbc.driver>org.hsqldb.jdbcDriver</jdbc.driver>
                <jdbc.url>jdbc:hsqldb:file:${r"${"}database.name}</jdbc.url>
                <jdbc.user>${r"${"}database.user}</jdbc.user>
                <jdbc.password>${r"${"}database.password}</jdbc.password>
                <!-- hibernate -->
                <hibernate.dialect>org.hibernate.dialect.HSQLDialect</hibernate.dialect>
            </properties>
        </profile>
        <profile>
            <id>mysql</id>
            <properties>
                <!-- jdbc driver dependency -->
                <jdbc.groupId>mysql</jdbc.groupId>
                <jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
                <jdbc.version>5.1.17</jdbc.version>
                <!-- jdbc settings -->
                <jdbc.type>mysql</jdbc.type>
                <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
                <!-- see http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html -->
                <jdbc.url>jdbc:mysql://${r"${"}database.host}:${r"${"}database.port}/${r"${"}database.name}?zeroDateTimeBehavior=convertToNull</jdbc.url>
                <jdbc.user>${r"${"}database.user}</jdbc.user>
                <jdbc.password>${r"${"}database.password}</jdbc.password>
                <!-- hibernate MySQL 5 mapping -->
                <hibernate.dialect>org.hibernate.dialect.MySQL5InnoDBDialect</hibernate.dialect>
            </properties>
        </profile>
    </profiles>
    
    <repositories>
        <repository>
            <id>java.net2</id>
            <name>Repository hosting the jee6 artifacts</name>
            <url>http://download.java.net/maven/2</url>
        </repository>
        <repository>
            <id>spring-maven-release</id>
            <name>Spring Maven Release Repository</name>
            <url>http://maven.springframework.org/release</url>
        </repository>
        <repository>  
            <id>prime-repo</id>  
            <name>PrimeFaces Maven Repository</name>  
            <url>http://repository.primefaces.org</url>  
            <layout>default</layout>  
        </repository> 
    </repositories>
    
   
    <dependencies>
        <!-- App specific dependencies --> 
		
		
        
        <!-- Jasperreports dependencies -->
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>3.7.6</version>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>
   
        <!-- Primefaces dependencies --> 
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>${r"${"}primefaces.version}</version>
        </dependency>
        <dependency><!-- optional theme (see also web.xml to enable it) -->
            <groupId>org.primefaces.themes</groupId>
            <artifactId>casablanca</artifactId>
            <version>1.0.2</version>
        </dependency>
            
        <!-- Spring dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${r"${"}spring.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${r"${"}spring.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${r"${"}spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${r"${"}spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${r"${"}spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${r"${"}spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${r"${"}spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${r"${"}spring.version}</version>
            <classifier/>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${r"${"}spring.version}</version>
            <classifier/>
        </dependency>
        
        <#if includeLoginSpring>
        <!-- Spring security dependencies -->
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>jsr250-api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${r"${"}spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${r"${"}spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-acl</artifactId>
            <version>${r"${"}spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${r"${"}spring-security.version}</version>
        </dependency>
        </#if>

        <!-- Aspectj -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>${r"${"}aspectj.version}</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>${r"${"}aspectj.version}</version>
        </dependency>
               
        <!-- ORM dependencies -->
        <dependency>
            <groupId>${r"${"}jdbc.groupId}</groupId>
            <artifactId>${r"${"}jdbc.artifactId}</artifactId>
            <version>${r"${"}jdbc.version}</version>
            <classifier/>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${r"${"}hibernate.version}</version>
            <classifier/>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${r"${"}hibernate.version}</version>
            <classifier/>
            <exclusions>
                <exclusion>
                    <groupId>cglib</groupId>
                    <artifactId>cglib</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>dom4j</groupId>
                    <artifactId>dom4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <version>1.0.0.Final</version>
            <classifier/>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.1.0.Final</version>
            <classifier/>
            <exclusions>
                <exclusion>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <classifier/>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>2.2</version>
            <classifier/>
        </dependency>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
            <classifier/>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.3</version>
            <classifier/>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-pool</groupId>
                    <artifactId>commons-pool</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xerces</groupId>
                    <artifactId>xerces</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xerces</groupId>
                    <artifactId>xercesImpl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                </exclusion>
            </exclusions>
        </dependency>        
        
        <!-- Commons dependencies -->
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.5.4</version>
            <classifier/>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-digester</groupId>
            <artifactId>commons-digester</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
        </dependency>

        
        <!-- JSF dependencies -->
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>${r"${"}jsf.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>${r"${"}jsf.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>

        <!-- Logging dependencies --> 
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${r"${"}slf4j.version}</version>
        </dependency>
               
        <#--
        <dependency>
            <groupId>net.sf.opencsv</groupId>
            <artifactId>opencsv</artifactId>
            <version>2.3</version>
        </dependency>
        -->
        
         <!-- Test dependencies -->  
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
    

    <build>
          <resources>
            <!-- step 1: copy all properties, and replace all with their corresponding values defined in the properties -->
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>log4j.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
            <!-- step 2: copy ressources all non properties as-is -->
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.properties</exclude>
                    <exclude>log4j.xml</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <encoding>${r"${"}project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>${r"${"}java.version}</source>
                    <target>${r"${"}java.version}</target>
                    <encoding>${r"${"}project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
		    <plugin>
		    	<groupId>org.apache.maven.plugins</groupId>
		      	<artifactId>maven-surefire-plugin</artifactId>
		        <version>2.11</version>
		        <configuration>
		          <skipTests>true</skipTests>
		        </configuration>
		    </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <failOnMissingWebXml>true</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
	          <groupId>org.codehaus.mojo</groupId>
	          <artifactId>tomcat-maven-plugin</artifactId>
	          <version>1.1</version>
	          <executions>
              	<execution>
                	<id>tomcat-run</id>
                	<goals>
                    	<goal>run-war</goal>
                    </goals>
                    <phase>package</phase>
                    <configuration>
            			<path>/${r"${"}project.name}</path>
         			</configuration>
              	</execution>
              </executions>
	          <dependencies>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>catalina</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>catalina-ha</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>tribes</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>el-api</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>jasper</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>jasper-el</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>jasper-jdt</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>jsp-api</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>servlet-api</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>coyote</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	            <dependency>
	              <groupId>org.apache.tomcat</groupId>
	              <artifactId>dbcp</artifactId>
	              <version>${r"${"}tomcat.version}</version>
	              <scope>runtime</scope>
	            </dependency>
	          </dependencies>
	        </plugin>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${r"${"}jetty.version}</version>
                <configuration>
                    <webAppConfig>
                        <contextPath>/${r"${"}project.name}</contextPath>
                    </webAppConfig>
                </configuration>
                  <!--
                <executions>
                    <execution>
                        <id>jetty-run</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
                -->
            </plugin>
        </plugins>
        <finalName>${r"${"}project.name}</finalName>
    </build>
</project>
</#if>
